package com.asia5b.a5bmall.same.dialog

import android.content.Context
import android.view.Gravity
import com.asia5b.a5bmall.same.R
import com.asia5b.a5mall.middleware.model.shop.AgreementModel
import com.asia5b.a5mall.middleware.base.BaseDialog
import kotlinx.android.synthetic.main.dialog_applyshopagree.*

/**
 * Created by zhangyuncai on 2020/6/29.
 */
class ApplyShopAgreeDialog constructor(context: Context, var model: AgreementModel) : BaseDialog(context) {
    override val layoutId: Int = R.layout.dialog_applyshopagree
    override val widthPercent: Double = 0.9
    override val heightPercent: Double = 0.8
    override val gravity: Int = Gravity.CENTER
    val webView by lazy {
        tv_apply_content
    }


    override fun initView() {
        tv_apply_title.text = model.article_name
        webView.getSettings().setJavaScriptEnabled(false)
        webView.loadData(model.content, "text/html", "utf-8")
    }

    override fun initEvent() {
        tv_apply_close.setOnClickListener {
            mCancelClick?.invoke()
            dismiss()
        }
        tv_apply_agree.setOnClickListener {
            mSureClick?.invoke(true)
            dismiss()
        }
    }


}